# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=maliit-keyboard
pkgver=2.3.1
pkgrel=1
pkgdesc="Maliit Keyboard 2"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://github.com/maliit/keyboard"
license="LGPL-3.0-only AND BSD-3-Clause AND CC-BY-SA-3.0"
depends="dconf"
makedepends="
	anthy-dev
	cmake
	glib-dev
	hunspell-dev
	libpinyin-dev
	maliit-framework-dev
	presage-dev
	qt5-qtbase-dev
	qt5-qtfeedback-dev
	qt5-qtmultimedia-dev
	"
checkdepends="xvfb-run"
source="$pkgname-$pkgver.tar.gz::https://github.com/maliit/keyboard/archive/$pkgver/keyboard-$pkgver.tar.gz"
subpackages="$pkgname-doc"
options="!check" # Disabled
builddir="$srcdir/keyboard-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-Denable-tests=OFF # Broken https://github.com/maliit/keyboard/issues/7
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bf6eee534d6fceb6e9d1ac5b20d085db9ccd0c7859137d3840349974eaff9cc3d49b6d4ee52543810b33ff85e228fd4a9c37501e0c69b0394c2848a229e5ab8e  maliit-keyboard-2.3.1.tar.gz
"
